.class public Lcn/a/b/b/a;
.super Ljava/lang/Object;


# instance fields
.field public a:Ljava/util/ArrayList;

.field private b:Ljava/lang/StringBuilder;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    iput-object v0, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    return-void
.end method


# virtual methods
.method public declared-synchronized a(Ljava/util/zip/GZIPInputStream;)I
    .locals 9

    const/4 v3, 0x1

    const/4 v1, 0x0

    monitor-enter p0

    :try_start_0
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcn/a/b/b/a;->a:Ljava/util/ArrayList;

    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    :try_start_1
    invoke-virtual {p0, p1}, Lcn/a/b/b/a;->b(Ljava/util/zip/GZIPInputStream;)I

    move-result v5

    move v2, v1

    :goto_0
    if-lt v2, v5, :cond_1

    new-instance v0, Lcn/a/b/a/a;

    invoke-direct {v0}, Lcn/a/b/a/a;-><init>()V

    move-object v2, v0

    :cond_0
    :goto_1
    invoke-virtual {p0, p1}, Lcn/a/b/b/a;->c(Ljava/util/zip/GZIPInputStream;)I

    move-result v5

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-lez v0, :cond_4

    new-instance v6, Lcn/a/b/a/b;

    iget-object v0, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    const/4 v0, 0x0

    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/ArrayList;

    invoke-direct {v6, v7, v0}, Lcn/a/b/a/b;-><init>(Ljava/lang/String;Ljava/util/ArrayList;)V

    invoke-virtual {v2, v6}, Lcn/a/b/a/a;->a(Lcn/a/b/a/b;)V

    const/4 v0, 0x0

    invoke-virtual {v4, v0}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    :goto_2
    if-eqz v5, :cond_0

    if-ne v5, v3, :cond_5

    iget-object v0, p0, Lcn/a/b/b/a;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    new-instance v0, Lcn/a/b/a/a;

    invoke-direct {v0}, Lcn/a/b/a/a;-><init>()V

    move-object v2, v0

    goto :goto_1

    :cond_1
    new-instance v6, Ljava/util/ArrayList;

    invoke-direct {v6}, Ljava/util/ArrayList;-><init>()V

    move v0, v3

    :goto_3
    if-nez v0, :cond_2

    add-int/lit8 v0, v2, 0x1

    move v2, v0

    goto :goto_0

    :cond_2
    invoke-virtual {p0, p1}, Lcn/a/b/b/a;->b(Ljava/util/zip/GZIPInputStream;)I

    move-result v7

    const v8, 0xffff

    if-ne v7, v8, :cond_3

    invoke-virtual {v4, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    move v0, v1

    goto :goto_3

    :cond_3
    mul-int/lit8 v7, v7, 0x64

    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_3

    :catch_0
    move-exception v0

    const/4 v1, 0x2

    :try_start_2
    iget-object v2, p0, Lcn/a/b/b/a;->a:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->clear()V

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    move v0, v1

    :goto_4
    :try_start_3
    invoke-virtual {p1}, Ljava/util/zip/GZIPInputStream;->close()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_1
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2

    :goto_5
    monitor-exit p0

    return v0

    :cond_4
    :try_start_4
    new-instance v0, Lcn/a/b/a/b;

    iget-object v6, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    const/4 v7, 0x0

    invoke-direct {v0, v6, v7}, Lcn/a/b/a/b;-><init>(Ljava/lang/String;Ljava/util/ArrayList;)V

    invoke-virtual {v2, v0}, Lcn/a/b/a/a;->a(Lcn/a/b/a/b;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0

    goto :goto_2

    :catchall_0
    move-exception v0

    :try_start_5
    invoke-virtual {p1}, Ljava/util/zip/GZIPInputStream;->close()V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_1
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_1

    :goto_6
    :try_start_6
    throw v0
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_1

    :catchall_1
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_5
    if-gez v5, :cond_0

    :try_start_7
    iget-object v0, p0, Lcn/a/b/b/a;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_0
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_0

    move v0, v1

    goto :goto_4

    :catch_1
    move-exception v1

    :try_start_8
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_6

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_1

    goto :goto_5
.end method

.method b(Ljava/util/zip/GZIPInputStream;)I
    .locals 2

    invoke-virtual {p1}, Ljava/util/zip/GZIPInputStream;->read()I

    move-result v0

    shl-int/lit8 v0, v0, 0x8

    invoke-virtual {p1}, Ljava/util/zip/GZIPInputStream;->read()I

    move-result v1

    or-int/2addr v0, v1

    return v0
.end method

.method c(Ljava/util/zip/GZIPInputStream;)I
    .locals 5

    const/4 v0, 0x0

    const/4 v1, -0x1

    iget-object v2, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    iget-object v3, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->length()I

    move-result v3

    invoke-virtual {v2, v0, v3}, Ljava/lang/StringBuilder;->delete(II)Ljava/lang/StringBuilder;

    new-instance v2, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v2}, Ljava/io/ByteArrayOutputStream;-><init>()V

    :goto_0
    invoke-virtual {p1}, Ljava/util/zip/GZIPInputStream;->read()I

    move-result v3

    if-ne v3, v1, :cond_1

    move v0, v1

    :cond_0
    :goto_1
    iget-object v1, p0, Lcn/a/b/b/a;->b:Ljava/lang/StringBuilder;

    const-string v3, "UTF-8"

    invoke-virtual {v2, v3}, Ljava/io/ByteArrayOutputStream;->toString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/io/ByteArrayOutputStream;->close()V

    return v0

    :cond_1
    if-eqz v3, :cond_0

    const/16 v4, 0xa

    if-ne v3, v4, :cond_2

    const/4 v0, 0x1

    goto :goto_1

    :cond_2
    invoke-virtual {v2, v3}, Ljava/io/ByteArrayOutputStream;->write(I)V

    goto :goto_0
.end method
